<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>邀请好友</title>
    <link rel="stylesheet" href="static/css/aui.2.0.css">
    <link rel="stylesheet" href="static/css/alert.css">
    <link rel="stylesheet" href="static/css/share.css">
</head>
<body>
    <section class="title-box">
        <div class="title-max">多卖宝</div>
        <div class="title-little">消费多返利多</div>
    </section>
    <section class="share-box">
        <img src="static/img/user.jpg" class="user-pic" alt="">
        <div class="share-content">
            <div class="share-people">
                <div class="share-people-one">
                    <span>鞋子湿了</span> 送您一个现金红包
                </div>
                <div>邀请您成为TA的多卖宝好友</div>
            </div>
            <div class="share-login-code"></div>
            <div class="share-line">
                <div class="line"></div>
                <div>全场通用</div>
                <div class="line"></div>
            </div>
            <div class="share-input">
                <input type="password" class="share-number" placeholder="设置登录密码">

                <div class="share-code-box">
                    <input type="password" class="share-code" placeholder="确认密码">
                </div>
            </div>
            <div class="pull-hongbao">下一步</div>
        </div>
    </section>

    <script src="lib/jquery-3.0.0.min.js"></script>
    <script src="static/js/alert.js"></script>
    <script src="static/js/function.js"></script>
    <script>
            /*这里后台请求获取验证码*/
            $('.pull-hongbao').click(function () {
                var phone = $('.share-number').val();
                var pass=$('.share-code').val();
//            var validate=RegExp(/^(0|86|17951)?(13[0-9]|15[0123456789]|18[0-9]|14[57])[0-9]{8}$/).test(phone);
                var validate=RegExp(/[\@A-Za-z0-9\!\#\$\%\^\&\*\.\~]{6,22}$/).test(phone);
                var validate1=RegExp(/[\@A-Za-z0-9\!\#\$\%\^\&\*\.\~]{6,22}$/).test(pass);
                //验证用户是否输入了手机号
                if(phone==''){
                    dialog.tusiError('请设置密码',1000);
                    return;
                }
                if(pass==''){
                    dialog.tusiError('请再次输入密码',1000);
                    return;
                }
                if (!validate){
                    dialog.tusiError('请输入符合规范的密码',1000);
                    return;
                }
                if (!validate1){
                    dialog.tusiError('请输入符合规范的密码',1000);
                    return;
                }
                window.location.href='share_success.html'
            })

    </script>

</body>
</html>